package IO流.对象流.ObjectOutputStream.Test01;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectOutputStreamTest01 {
    public static void main(String[] args) {
        Dio dio = new Dio(120,"迪奥撒玛");
        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(new FileOutputStream("D:\\Desktop\\IDEA\\javase\\src\\IO流\\对象流\\ObjectOutputStream\\Test01\\Dio"));
            oos.writeObject(dio);

            oos.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }finally{
            if (oos != null) {
                try {
                    oos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
